import request from "@/utils/request";

//登录接口
export const login = (data) => request.post("/user/login", data);
//收集
export const getCollect = () => request.get("/user/favorites");
//出租
export const getRent = () => request.get("/user/houses");
//获取用户的信息资料
export const getUser =(data)=>request.get('/user',{
  params:{
    ...data,
  }
})
// 获取热门城市
export const getCity = () => request.get('/area/hot')
//获取城市数据
export const getAllCity = () => request.get('/area/city?level=1')
//发布房屋
export const gethouse=()=>request.get('/houses/params')
// 筛选房屋的时候获取房屋数据
export const getsearchhouse = () => {
  return request.get('/houses/condition?id=AREA%7C88cff55c-aaa4-e2e0')
}
export const getSearch=()=>request.get('')
// 发布房源
export const issueHouse = (obj) => {
  return request.post('/user/houses', obj)
}
// 房屋图像上传接口
export const uploadImage = (data) => {
  return request.post('/houses/image', data, {
    headers: { 'Content-Type': 'multipart/form-data' }
  })
}
// 获取地图数据
export const getMap = () => {
  return request.get('/area/map?id=AREA%7C88cff55c-aaa4-e2e0')
}
export const getNewMap = (id) => {
  return request.get('/area/map', {
    params: {
      id
    }
  })
}